package com.echo.acc.controller;

import com.echo.acc.framework.aspect.OperationLog;
import com.echo.acc.framework.result.Result;
import com.echo.acc.pojo.Users;
import com.echo.acc.service.UsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author echo
 * date 2023-12-22 10:26:01
 **/
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UsersService usersService;

    @OperationLog(desc = "用户登录")
    @PostMapping("/login")
    public Result<Users> login(Users users) {
        Users login = usersService.login(users);
        return Result.packageResultMethod(login);
    }

}
